package com.yubest.mqtt.handler;

import com.yubest.mqtt.consts.Consts;
import org.springframework.integration.annotation.Gateway;
import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.Message;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;

/**
 * 生产者
 *
 * @Author: hweiyu
 * @Date: 2022/11/11 10:08
 */
@MessagingGateway
@Component
public interface MqttProducer {

    @Gateway(requestChannel = Consts.OUTPUT_CHANNEL)
    void send(@Header(MqttHeaders.TOPIC) String topic, Message<String> message);
}
